<template>
  <div class="second">
    <div>
      <div class="first">
        <h3>租房小组</h3>
        <span>更多</span>
      </div>
      <!-- <van-grid v-for="item in rent" :key="item.id">
        <van-grid-item :icon="item.imgSrc" :text="item.title" />
      </van-grid> -->
      <van-grid :column-num="2" :gutter="10">
        <van-grid-item
          v-for="item in rent"
          :key="item.id"
          :icon="item.imgSrc"
          :text="item.title"
        />
      </van-grid>
    </div>
  </div>
</template>

<script>
import { rentGroup } from '@/api/index'
export default {
  name: 'rent-page',
  async created() {
    const res = await rentGroup()
    // console.log(res.data.body)
    res.data.body = res.data.body.map((item) => {
      item.imgSrc = 'http://liufusong.top:8080' + item.imgSrc
      return item
    })
    // 把数据给到data
    this.rent = res.data.body
    // console.log(this.images)
  },
  data() {
    return {
      rent: []
    }
  },
  methods: {}
}
</script>

<style scoped lang="less">
.second {
  background-color: #f6f5f6;
}
.first {
  height: 50px;
  line-height: 50px;
  padding: 0 15px;
  h3 {
    float: left;
  }
  span {
    font-size: 14px;
    float: right;
  }
}
</style>
